package com.zyong.design.pattern.visitor.case3;

/**
 * 具体的数据结构 矩形
 * @program: zyong-design-pattern
 * @ClassName: Rectangle
 * @author: zyong
 * @create: 2024-03-30 00:35
 */
public class Rectangle implements Element {
    /**
     * 宽
     */
    private final double width;
    /**
     * 高
     */
    private final double height;

    public Rectangle(double width, double height) {
        this.width = width;
        this.height = height;
    }

    public double getWidth() {
        return width;
    }

    public double getHeight() {
        return height;
    }

    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }
}
